package a;

import java.util.Collection;

public class Main {

    public static void main(String[] args) {
        NetworkSpace mRoutes = new NetworkSpace();
        CIDRIP ip = new CIDRIP("192.168.2.1",32);
        mRoutes.addIP(ip, false);
        mRoutes.addIP(new CIDRIP("0.0.0.0",0), true);
        Collection<NetworkSpace.ipAddress> positiveIPv4Routes = mRoutes.getPositiveIPList();
        for (NetworkSpace.ipAddress route : positiveIPv4Routes) {
            try {
                System.out.println("add route : " + route.getIPv4Address()+"/"+route.networkMask);
            } catch (IllegalArgumentException e) {
                e.printStackTrace();
            }
        }
    }
}
